<html lang="en" xmlns:th="http://www.thymeleaf.org">
<div th:fragment="addAndEditDiv" style="display: none" id="addAndEditId">
    <form class="layui-form" action="" id="addAndEditForm">
        <input type="hidden" name="id" id="id">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline">
                <input type="text" name="userName" lay-verify="required" placeholder="请输入用户名" autocomplete="off"
                       class="layui-input" lay-reqtext="用户名是必填项，岂能为空？">
            </div>
            <label class="layui-form-label">密码</label>
            <div class="layui-input-inline">
                <input type="hidden" id="pwd" name="userPwd">
                <input type="password" name="userPwd" lay-verify="required|pass" placeholder="请输入密码" autocomplete="off"
                       class="layui-input" lay-reqtext="密码是必填项，岂能为空？">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">昵称</label>
            <div class="layui-input-inline">
                <input type="text" name="nickName" lay-verify="required" placeholder="请输入昵称" autocomplete="off"
                       class="layui-input" lay-reqtext="昵称是必填项，岂能为空？">
            </div>
            <label class="layui-form-label">角色</label>
            <div class="layui-input-inline">
                <select name="roleId">
                    <option value="-1">请选择角色</option>
                    <option th:each="role : ${roles}" th:value="${role.getId()}" th:text="${role.getRoleName()}"></option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">部门</label>
            <div class="layui-input-inline">
                <select name="deptId">
                    <option value="-1">请选择部门</option>
                    <option th:each="dept : ${depts}" th:value="${dept.getId()}" th:text="${dept.getDeptName()}"></option>
                </select>
            </div>
            <label class="layui-form-label">岗位</label>
            <div class="layui-input-inline">
                <select name="posId">
                    <option value="-1">请选择岗位</option>
                    <option th:each="pos : ${poss}" th:value="${pos.getId()}" th:text="${pos.getPosName()}"></option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit="" lay-filter="subBtn">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
</html>